<div class="navbar navbar-inverse navbar-fixed-top" role="navigation" id="menu-nav">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">切换导航</span>
                <!--.sr-only是 除了屏幕阅读器外，其他设备上隐藏该元素，这个是用于屏幕阅读器的，帮助残障人士更好的访问网站。-->
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="teacherIndex" style="color: white">学生档案管理系统</a>
        </div>
        <div class="navbar-collapse collapse">
            <div class="row">
                <div class="col-lg-6 header-search">
                </div>
                <%
                if(login){
                %>
                <ul class="nav navbar-nav navbar-right">
                    <li><a>欢迎您！<%= username %>老师</a></li>
                    <li><a data-toggle="modal" class="scrollto" data-target="#change-password">更改密码</a></li>
                    <li><a href="/teacherInfo">个人信息</a></li>
                    <li><a href="/exit">退出</a></li>
                </ul>
                <%
                }else{
                %>
                <ul class="nav navbar-nav">
                    <li
                            <% if(active == "首页"){ %>
                            class="active"
                            <% } %>
                    >
                        <a href="/">官网详情</a>
                    </li>
                    <li
                            <% if(active == "注册"){ %>
                            class="active"
                            <% } %>
                    >
                        <a href="/regist">注册</a>
                    </li>
                    <li
                            <% if(active == "登录"){ %>
                            class="active"
                            <% } %>
                    >
                        <a href="/login">登录</a>
                    </li>
                    <li
                            <% if(active == "404"){ %>
                            class="active"
                            <% } %>
                    >
                        <!--<a href="/404">404页面</a>-->
                    </li>
                </ul>
                <%
                }
                %>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="change-password" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                <h4 class="modal-title-login" id="myModalLabel">更改密码</h4>
            </div>
            <div class="modal-body">
                <form method="post" action="" class="form-horizontal" id="">
                    <div class="form-group has-feedback">
                        <label for="input" class="col-sm-2 control-label">账号</label>
                        <div class="col-sm-10">
                            <input id="dengluming" type="text" class="form-control" disabled value="<%= username %>"
                                   placeholder="">
                        </div>
                    </div>
                    <div class="form-group has-feedback">
                        <label for="input" class="col-sm-2 control-label">旧密码</label>
                        <div class="col-sm-10">
                            <input  type="password" class="form-control" value=""
                                   placeholder="请输入旧密码">
                        </div>
                    </div>
                    <div class="form-group has-feedback">
                        <label for="input" class="col-sm-2 control-label">新密码</label>
                        <div class="col-sm-10">
                            <input  type="password" class="form-control" value=""
                                   placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="form-group has-feedback">
                        <label for="input" class="col-sm-2 control-label">再次确认</label>
                        <div class="col-sm-10">
                            <input id="mima" type="password" class="form-control" value=""
                                   placeholder="请再次确认新密码">
                        </div>
                    </div>
                </form>
                <button type="submit" id="changePasswordTeacherBtn"
                        class="btn btn-success submit-btn-style">提交
                </button>
                <hr style="margin-top:12px; clear: both" >
                <div class="form-horizontal">

                    <div class="clearfix">
                        <div class="pull-left">
                            <p class="form-control-static">Back home?</p>
                        </div>
                        <div class="pull-right">
                            <a href="/teacherIndex" class="btn btn-outline btn-default">return</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
//    //changePasswordTeacher
    $("#changePasswordTeacherBtn").click(function () {
        console.log("!11111111");
        //用ajax提交表单
        $.post("/changePasswordTeacher", {
            "dengluming": $("#dengluming").val(),
            "mima": $("#mima").val()
        }, function (result) {
            if (result == "1") {
                alert("更改成功！");
            } else {
                alert("更改失败！");
            }
        })
    })
</script>